package com.example.amusic.service

import androidx.annotation.MainThread
import androidx.lifecycle.LiveData
import androidx.media3.common.MediaItem
import androidx.media3.common.MediaMetadata
import androidx.media3.common.Player
import kotlinx.coroutines.flow.MutableStateFlow

interface PlayerController {
    val playList: LiveData<List<MediaItem>>
    val currentSong: LiveData<MediaItem?>
    val playState: MutableStateFlow<PlayState>
    val playProgress: MutableStateFlow<Long>
    val bufferingPercent: MutableStateFlow<Long>
    val playMode: MutableStateFlow<PlayMode>


    @MainThread
    fun addAndPlay(song: MediaItem)

    @MainThread
    fun replaceAll(songList: List<MediaItem>, song: MediaItem)

    @MainThread
    fun play(mediaId: String)

    @MainThread
    fun delete(song: MediaItem)

    @MainThread
    fun clearPlayList()

    @MainThread
    fun playPause()

    @MainThread
    fun next()

    @MainThread
    fun prev()

    @MainThread
    fun seekTo(msec: Int)

    @MainThread
    fun getAudioSession(): Int

    @MainThread
    fun setPlayMode(mode: PlayMode)

    @MainThread
    fun stop()




}